{% extends 'tests/page.html' %}

{% block content %}
<h2>Часть A</h2>
{#Список блоков заданий с перечеслением вопросов. С возможность добавить/отредактировать вопрос/группу.#}
<a href="group/a/add/">Добавить группу вопросов</a>
<ol>
	{% for questionGroup in questionGroups %}
		{% if questionGroup.type == 'A' %}
			<li>
				{{ questionGroup.title }} 
				<a href="{% url src.tests.views.groupView test=questionGroup.test.id,id=questionGroup.id %}q/add/">
					<img src="{{ MEDIA_URL }}images/add.png" />
				</a>
				<a href="{% url src.tests.views.groupView test=questionGroup.test.id,id=questionGroup.id %}edit/">
					<img src="{{ MEDIA_URL }}images/edit.png" />
				</a>
				<a href="{% url src.tests.views.groupView test=questionGroup.test.id,id=questionGroup.id %}delete/" class="delete">
					<img src="{{ MEDIA_URL }}images/delete.png" />
				</a>
				
				<ul type="none">
					{% for question in questionGroup.questiona_set.all %}
						<li>
							{{ question.question }}
							<a href="{% url src.tests.views.groupView test=questionGroup.test.id,id=questionGroup.id %}q/edit/{{ question.id }}/">
								<img src="{{ MEDIA_URL }}images/edit.png" />
							</a>
							<a href="{% url src.tests.views.groupView test=questionGroup.test.id,id=questionGroup.id %}q/delete/{{ question.id }}/" class="delete">
								<img src="{{ MEDIA_URL }}images/delete.png" />
							</a>
						</li>
					{% endfor %}
				</ul>
			</li>
		{% endif %}
	{% endfor %}
</ol>

<h2>Часть B</h2>
<a href="group/b/add/">Добавить группу вопросов</a>
<ol>
	{% for questionGroup in questionGroups %}
		{% if questionGroup.type == 'B' %}
			<li>
				{{ questionGroup.title }} 
				<a href="{% url src.tests.views.groupView test=questionGroup.test.id,id=questionGroup.id %}q/add/">
					<img src="{{ MEDIA_URL }}images/add.png" />
				</a>
				<a href="{% url src.tests.views.groupView test=questionGroup.test.id,id=questionGroup.id %}edit/">
					<img src="{{ MEDIA_URL }}images/edit.png" />
				</a>
				<a href="{% url src.tests.views.groupView test=questionGroup.test.id,id=questionGroup.id %}delete/" class="delete">
					<img src="{{ MEDIA_URL }}images/delete.png" />
				</a>
				
				<ul type="none">
					{% for question in questionGroup.questionb_set.all %}
						<li>
							{{ question.question }}
							<a href="{% url src.tests.views.groupView test=questionGroup.test.id,id=questionGroup.id %}q/edit/{{ question.id }}/">
								<img src="{{ MEDIA_URL }}images/edit.png" />
							</a>
							<a href="{% url src.tests.views.groupView test=questionGroup.test.id,id=questionGroup.id %}q/delete/{{ question.id }}/" class="delete">
								<img src="{{ MEDIA_URL }}images/delete.png" />
							</a>
						</li>
					{% endfor %}
				</ul>
			</li>
		{% endif %}
	{% endfor %}
</ol>

{% endblock %}